<template>
	<view class="content">
		<view class="container" v-for="(item,index) in approvalList" :key="index">
			<view class="imgContainer">
				<image src="../static/tarbar/index-active.png" mode=""></image>
			</view>
			<view class="info">
				<view>{{item.number | dept}}</view>
				<view>{{item.auditUserName}}</view>
				<view v-if="item.status == 1 || item.status ==2">{{item.updateTime}}</view>
			</view>
			<view :class="item.status == 1 ? 'item1': 'item2'">{{item.status|statusText}}</view>
		</view>
	</view>
</template>

<script>
	import {
		getLicenceAuditList
	} from '@/api/workTicket/index.js'
	export default {
		data() {
			return {
				approvalList: [],
				id: ''
			}
		},
		onLoad: function(options) {
			this.id = options.id
		},
		mounted() {
			this.getList()
		},
		methods: {
			getList() {
				getLicenceAuditList({
					licenceId: this.id
				}).then(res => {
					this.approvalList = res
				})
			}
		},
		filters: {
			statusText(a) {
				let name = ''
				switch (a) {
					case -1:
						name = '未审核';
						break;
					case 0:
						name = '审核中'
						break;
					case 1:
						name = '审核通过'
						break;
					case 2:
						name = '已驳回'
						break;

				}
				return name
			},
			dept(a){
				let name = ''
				switch (a) {
					case 1:
						name = '许可人';
						break;
					case 2:
						name = '签发人'
						break;
					case 3:
						name = '分管负责人'
						break;
					case 4:
						name = '主要负责人'
						break;
				
				}
				return name
			}
		}
	}
</script>

<style scoped lang="scss">
	.content {
		width: 100%;
		height: 100vh;
		background-color: #fff;
		padding-top: 10px;
	}

	.container {
		display: flex;
		flex-direction: row;
		background-color: rgba(239,232,232,0.5);
		// width: 96%;
		height: 78px;
		margin: 0 auto 10px;
		align-items: center;
		justify-content: space-around;
		// border-radius: 20px;
	}

	.imgContainer {
		width: 30%;
		display: flex;
		justify-content: center;

		image {
			width: 80rpx;
			height: 80rpx;
		}
	}

	.time {
		width: 100%;
		height: 5vh;
		line-height: 5vh;
		margin-left: 2%;
	}

	.info {
		width: 30%;
	}

	.item1 {
		color: green;
	}

	.item2 {
		color: red;
	}
</style>
